package com.dinglexiao.utils;


import java.util.Random;

/**
 * @author dingl
 * @ClassName : SaltecreatUtils
 * @Description : salt创建工具类
 * @date 2020/9/11-16:27
 */
public class SaltecreatUtils {

    public static String getSalt(int n){
        char[] keys = "ABCDEFGabcdefg!@#$%".toCharArray();

        StringBuffer sb = new StringBuffer();
        for(int i=0;i<n;i++){
            char salt = keys[new Random().nextInt(keys.length)];
            sb.append(salt);
        }
        return sb.toString();
    }
}
